package com.ypc.webdemo.utils;

import com.ypc.webdemo.controller.advice.GlobalExceptionHandler;

import java.util.Optional;

/**
 * @author yinpengcheng
 * @Date 2023/7/24
 */
public class MessageUtil {
    public static String getMessage(Throwable throwable) {
        return Optional.ofNullable(GlobalExceptionHandler.getThrowable(throwable).getMessage()).orElse("系统内部异常");
    }
}
